/*
 * Sesame Inc.
 * Copyright (c) 2009 All Rights Reserved.
 */
package com.sesame.service;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.sesame.domain.Message;
import com.sesame.toolkit.Page;

/**
 * @author shubeta
 * 
 */
@Transactional
public interface MessageService {
    public boolean isNewMessage(Message message, Map model);

    @Transactional(readOnly = true)
    public List<Message> listMessageBySender(Page page);

    @Transactional(readOnly = true)
    public List<Message> listMessageByReceiver(Page page);

    @Transactional(readOnly = true)
    public Message showMessage(Integer messageId);

    public void deleteMessage(String message, String flag);

    public void deleteMessage(String[] messages, String flag);

    @Transactional(readOnly = true)
    public Integer getMessageCount();

    @Transactional(readOnly = true)
    public Integer getSendedMessageCount(Integer senderId);

    @Transactional(readOnly = true)
    public Integer getReceivedMessageCount(Integer receiverId);

}